{include file=header.html}
<style type="text/css">
<!--
.error{
	color: red;
}
-->
</style>
<script language="javascript" type="text/javascript" src="{res file=js/jquery-1.2.6.js}"></script>
<script language="javascript" type="text/javascript" src="{lib file=jquery.plugins/jquery.validate.js}"></script>

<script type="text/javascript" charset="utf-8" src="{lib file="swfupload/swfupload.js"}"></script>
<script type="text/javascript" charset="utf-8" src="{lib file="swfupload/js/handlers.js"}"></script>
  <link type="text/css" rel="stylesheet" href="{lib file="swfupload/css/default.css"}"/>

<script type="text/javascript">
var GOODS_SWFU;
$(function(){
    GOODS_SWFU = new SWFUpload({
        upload_url: "index.php?app=comupload&act=newupload&belongs=15&id=11233243",
        flash_url: '{lib file="swfupload/swfupload.swf"}',
        post_params: {
            "ECM_ID": "{$smarty.cookies.ECM_ID}",
			"PHPSESSID":"{$phpsision}",
            "HTTP_USER_AGENT":"{$smarty.server.HTTP_USER_AGENT}",
            'ajax': 1
        },
        file_size_limit: "5 MB",
        file_types: "*.gif;*.jpg;*.jpeg;*.png",
        custom_settings: {
            upload_target: "goods_upload_progress",
            if_multirow: 1
        },

        // Button Settings
        button_image_url: '{lib file="swfupload/images/SmallSpyGlassWithTransperancy_17x18.png"}',
        button_width: 86,
        button_height: 18,
        button_text: '<span class="button">批量上传</span>',
        button_text_style: '.button { font-family: Helvetica, Arial, sans-serif; font-size: 12pt; font-weight: bold; color: #3F3D3E; } .buttonSmall { font-size: 10pt; }',
        button_text_top_padding: 0,
        button_text_left_padding: 18,
        button_window_mode: SWFUpload.WINDOW_MODE.TRANSPARENT,
        button_cursor: SWFUpload.CURSOR.HAND,

        // The event handler functions are defined in handlers.js
        file_queue_error_handler: fileQueueError,
        file_dialog_complete_handler: fileDialogComplete,
        upload_progress_handler: uploadProgress,
        upload_error_handler: uploadError,
        upload_success_handler: uploadSuccess,
        upload_complete_handler: uploadComplete,
        button_placeholder_id: "spanButtonPlaceholder",
        file_queued_handler : fileQueued
    });
});

function add_uploadedfile(file_data)
{
		  var file_arr=new Array();
		  file_arr.push(new Array(file_data.file_name,file_data.file_id));
		  $("#divSwfuploadContainer").append('<input type="hidden" name="upfiles[]" value="'+file_data.file_id+'" />');
		  		  $("div.uppic_con").append('<a href="download.php?id='+file_data.file_id+'"><img src="'+file_data.file_path+'" width="130" height="80" alt="图片"/></a><a class="pic_del" href="index.php? app=comupload&act=delete&id='+file_data.file_id+'" onClick="return confirm('+"{$lang.confirm_del_file}"+')" title="{$lang.delete}">&nbsp;</a>');


}
</script>

</script>
        <script language="JavaScript">
function add_file(obj) {
	var parent = obj.parentNode;
	var span = document.createElement('span');
	span.innerHTML = '<input type="file" name="files[]" class="input-2" hidefocus="true" /><a href="" onclick="remove_file(this);return false;" class="pic_del">移除</a><br /><br />';
	parent.insertBefore(span, obj);
}

function remove_file(obj) {
	var parent = obj.parentNode.parentNode;
	parent.removeChild(obj.parentNode);
}
	</script>

<script type="text/javascript">
	//注册表单验证
	$(function() {
		regionInit('regions');
		$('#register_form').validate({
			errorPlacement : function(error, element) {
				var error_td = element.parent('td');
				error_td.find('.field_notice').hide();
				error_td.append(error);
			},
			success : function(label) {
				label.addClass('validate_right').text('OK!');
			},
			onkeyup : false,
			rules : {
				user_name : {
					required : true,
					byteRange : [ 3, 25, '{$charset}' ],
					remote : {
						url : 'index.php?app=member&act=check_user&ajax=1',
						type : 'get',
						data : {
							user_name : function() {
								return $('#user_name').val();
							}
						},
						beforeSend : function() {
							var _checking = $('#checking_user');
							_checking.prev('.field_notice').hide();
							_checking.next('label').hide();
							$(_checking).show();
						},
						complete : function() {
							$('#checking_user').hide();
						}
					}
				},
				password : {
					required : true,
					minlength : 6
				},
				confirm_password : {
					required : true,
					equalTo : '#password'
				},
				factory_name : {
					required : true
				},
				email : {
					required : true,
					email : true,
					remote : {
						url : 'index.php?app=member&act=check_email&ajax=1',
						type : 'get',
						data : {
							email : function() {
								return $('#email').val();
							}
						}
					}
				},
				region_name : {
					required : true
				},
				address : {
					required : true,
					maxlength: 100
				},
				phone_tel : {
					required : check_phone
				},
				phone_mob : {
					required : check_phone
				},
				factory_charge : {
					required : true
				}
			},
			messages : {
				user_name : {
					required : '{$lang.user_name_required}',
					byteRange : '{$lang.user_name_limit}',
					remote : '{$lang.user_already_taken}'
				},
				password : {
					required : '{$lang.password_required}',
					minlength : '{$lang.password_length_limit}'
				},
				confirm_password : {
					required : '{$lang.password_confirm_please}',
					equalTo : '{$lang.password_inconsistent}'
				},
				factory_name : {
					required : '{$lang.factory_name_required}'
				},
				email : {
					required : '{$lang.email_required}',
					email : '{$lang.email_invalid}',
					remote : '{$lang.email_already_taken}'
				},
				region_name : {
					required : '{$lang.region_required}'
				},
				address : {
					required : '{$lang.address_required}',
					maxlength: '{$lang.address_length_error}'
				},
				phone_tel : {
					required : '{$lang.phone_tel_required}'
				},
				phone_mob : {
					required : '{$lang.phone_mob_required}'
				},
				factory_charge : {
					required : '{$lang.factory_charge_required}'
				}
			}
		});
	});
	 function check_phone(){
         return ($('#phone_tel').val() == '' && $('#phone_mob').val() == '');
     }
</script>
    <script type="text/javascript">
function chang_tab(obj)
{
	$(".introduce_ti p").each(function(){
		$(this).attr('class','');
	});
	$("#zc"+obj).attr('class','in_tis');
}
</script>
<style type="text/css">
input {
	vertical-align: -5px;_vertical-align: -1px;margin-right: 5px
}

.tab-frame {
	width: 750px;
}
</style>
<body class="body-bg" style="overflow: auto;">
<div class="header">
	<div class="logo">
		<h1>欢迎加入缘色供应链管理平台</h1>
		<h2>如果你工厂配套齐整（跟单、板房、车间、尾部），重品质，讲信誉，不管规模大小，都可以在平台上接单!</h2>
	</div>
</div>
	<div class="sub-body">
		<div class="tab-frame">
			<div><h2>请填写如下信息，尽可能多提供厂区照片，证明工厂实力：</h2></div>
			<form name="" id="register_form" method="post" action="" enctype="multipart/form-data">
				<table width="100%" cellspacing="0" cellpadding="0" class="tab-display">
					<tr>
						<td width="15%" align="right">用户名:&nbsp;&nbsp;</td>
						<td align="left">
							<input type="text" id="user_name" name="user_name" class="input-1" value=""
								style="width: 162px;" />
						</td>
					</tr>
					<tr>
						<td width="15%" align="right">登陆密码:&nbsp;&nbsp;</td>
						<td align="left">
							<input type="password" id="password" name="password" class="input-1" value=""
								style="width: 162px;" />
						</td>
					</tr>
					<tr>
						<td width="15%" align="right">确认密码:&nbsp;&nbsp;</td>
						<td align="left">
							<input type="password" id="confirm_password" name="confirm_password" class="input-1" value=""
								style="width: 162px;" />
						</td>
					</tr>
				</table>
				<table width="100%" cellspacing="0" cellpadding="0" class="tab-display">
					<tr>
						<th colspan="2" align="left" class="introduce_ti">&nbsp;&nbsp;&nbsp;&nbsp;基本资料</th>
					</tr>
					<tr>
						<td width="15%" align="right">工厂名称:&nbsp;&nbsp;</td>
						<td align="left">
							<input type="text" id="factory_name" name="factory_name" class="input-1" value=""
								style="width: 162px;" />
						</td>
					</tr>
					<tr>
						<td width="15%" align="right">负责人姓名:&nbsp;&nbsp;</td>
						<td align="left">
							<input type="text" id="factory_charge" name="factory_charge" class="input-1" value=""
								style="width: 162px;" />
						</td>
					</tr>
					<tr>
						<td width="15%" align="right">所在区域:&nbsp;&nbsp;</td>
						<td align="left" id="regions">
							<input type="hidden" id="region_id" name="region_id" value="" class="mls_id" />
				            <input type="hidden" id="region_name" name="region_name" value="" class="mls_names" />
				            <select>
				              <option>{$lang.select_pls}</option>
				              {html_options options=$regions}
				            </select>
						</td>
					</tr>
					<tr>
						<td width="15%" align="right">详细地址:&nbsp;&nbsp;</td>
						<td align="left">
							<input type="text" id="address" name="address" class="input-1" value=""
								style="width: 500px;" />
						</td>
					</tr>
					<tr>
						<td width="15%" align="right">固定电话:&nbsp;&nbsp;</td>
						<td align="left">
							<input type="text" id="phone_tel" name="phone_tel" class="input-1" value=""
								style="width: 162px;" />
						</td>
					</tr>
					<tr>
						<td width="15%" align="right">手机号码:&nbsp;&nbsp;</td>
						<td align="left">
							<input type="text" id="phone_mob" name="phone_mob" class="input-1" value=""
								style="width: 162px;" />
						</td>
					</tr>
					<tr>
						<td width="15%" align="right">邮箱:&nbsp;&nbsp;</td>
						<td align="left">
							<input type="text" id="email" name="email" class="input-1" value=""
								style="width: 162px;" />
						</td>
					</tr>
					<tr>
						<td width="15%" align="right">QQ:&nbsp;&nbsp;</td>
						<td align="left">
							<input type="text" id="is_qq" name="is_qq" class="input-1" value=""
								style="width: 162px;" />
						</td>
					</tr>
					<tr>
						<td width="15%" align="right">厂区图片：&nbsp;&nbsp;</td>
						<td align="left">
							<div  class="uppic_con">
								<!-- {if $files} -->
								<!-- {foreach from=$files item=file} -->
								<a href="download.php?id={$file.file_id}"><img src="{$file.file_path}" width="130" height="80" alt="图片"/></a><a class="pic_del" href="{url app=comupload&act=delete&id=$file.file_id}" onClick="return confirm('+"{$lang.confirm_del_file}"+')" title="{$lang.delete}">&nbsp;</a>
								<!-- {/foreach} -->
								<!-- {/if} -->
		                     </div>
		                    <div class="upload_wrap" >
							<ul>
								<li class="btn1">
									<div id="divSwfuploadContainer">
										<div id="divButtonContainer"><span id="spanButtonPlaceholder"></span>
										</div>
									</div>
								</li>
							</ul>
							<br />
							     <div id="goods_upload_progress"></div>
							</div>
						</td>
					</tr>
					<tr>
						<td colspan="2" align="center">
							<input type="submit" value="注  册" class="btn-2" />
							<input type="button" value="返  回" class="btn-2" onclick="history.back();" />
						</td>
					</tr>
				</table>
			</form>
		</div>
	</div>
</body>
{$async_sendmail}
</html>